package com.lc202407;

public class Solution268 {
    public int missingNumber(int[] nums) {
        int length = nums.length;
        int total = (length + 1) * length / 2;
        for (int num : nums) {
            total -= num;
        }
        return total;
    }
}
